calculate_coordinates Subroutine

public subroutine calculate_coordinates(current_index, ix, iy, iz, nx, ny, nz, coordinates, node_type)

Subroutine to calculate the coordinates of the units inside a kohonen layer

Type Bound

self_organizing_map

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: current_index
integer, intent(in) :: ix
integer, intent(in) :: iy
integer, intent(in) :: iz
integer, intent(in) :: nx
integer, intent(in) :: ny
integer, intent(in) :: nz
real(kind=wp), intent(out), dimension(:,:) :: coordinates
character(len=*), intent(in) :: node_type

Called by

proc~~calculate_coordinates~~CalledByGraph proc~calculate_coordinates self_organizing_map%calculate_coordinates proc~create_som self_organizing_map%create_som proc~create_som->proc~calculate_coordinates proc~read_som self_organizing_map%read_som proc~read_som->proc~calculate_coordinates proc~external_predict_map self_organizing_map%external_predict_map proc~external_predict_map->proc~create_som proc~train_som train_som proc~train_som->proc~create_som

Source Code

    subroutine calculate_coordinates(current_index,ix,iy,iz,nx,ny,nz,coordinates,node_type)
!========================================================================================
!!  Subroutine to calculate the coordinates of the units inside a kohonen layer 
        integer,intent(in) :: current_index,ix,iy,iz,nx,ny,nz
!!
        real(kind=wp),dimension(:,:),intent(out) :: coordinates
!!
        character(len=*),intent(in) :: node_type
!!
        coordinates(current_index,1)=dble(ix);
        coordinates(current_index,2)=dble(iy);
        coordinates(current_index,3)=dble(iz);
        !write(*,*) coordinates(current_index,1:3);
        if(trim(node_type) == 'hexagonal') then
            coordinates(current_index,1)=coordinates(current_index,1)+&
                  .5_wp*(mod(coordinates(current_index,2),2.0_wp));
            coordinates(current_index,2)=(dsqrt(3.0_wp)/2.0_wp)*coordinates(current_index,2);
        endif
!
    end subroutine calculate_coordinates